#include "HumanPlayer.h"

using namespace cmn;

HumanPlayer::HumanPlayer() :
	m_creature( 0 )
{}

HumanPlayer::HumanPlayer( Creature* creature ) :
	m_creature( creature )
{}

HumanPlayer::~HumanPlayer() {}

Creature* HumanPlayer::GetCreature() const {
	return m_creature;
}

void HumanPlayer::SetCreature( Creature* creature ) {
	m_creature = creature;
}

void HumanPlayer::KeyPressed( core::KeyboardKey key ) {
	m_creature->ProcessCommand( Command( CommandType::Press, int( key ) ) );
}

void HumanPlayer::KeyReleased( core::KeyboardKey key ) {
	m_creature->ProcessCommand( Command( CommandType::Release, int( key ) ) );
}

void HumanPlayer::ButtonPressed( core::MouseButton button ) {
	m_creature->ProcessCommand( Command( CommandType::Press, int( button ) ) );
}

void HumanPlayer::ButtonReleased( core::MouseButton button ) {
	m_creature->ProcessCommand( Command( CommandType::Release, int( button ) ) );
}

void HumanPlayer::OnMove( Vec2 pos ) {
	m_creature->ProcessCommand( Command( CommandType::Move, 0 ) );
}

void HumanPlayer::OnWheel( int pos ) {
	m_creature->ProcessCommand( Command( CommandType::Send, pos ) );
}
